package com.d3works.apps.base.web;

import com.d3works.apps.base.db.Frequency;
import com.d3works.apps.base.service.FrequencyService;
import com.d3works.inject.Beans;
import com.d3works.rpc.ActionRequest;
import com.d3works.rpc.ActionResponse;

public class FrequencyController {

  /** Computes summary of the {@code Frequency} in context. */
  public void computeSummary(ActionRequest request, ActionResponse response) {
    Frequency frequency = request.getContext().asType(Frequency.class);
    response.setValue("summary", Beans.get(FrequencyService.class).computeSummary(frequency));
  }
}
